﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Exam.Core.DBUtility;

namespace Exam.Core.SQLDAL
{
    public class Department {
        //返回所有
        public List<Exam.Core.Model.Department> getDepartmentAllList(string departmentid) {
            List<Exam.Core.Model.Department> list = new List<Exam.Core.Model.Department>();
            string SQL = "SELECT * FROM Department WHERE DepartmentID IN (" + departmentid.Trim(',') + " )";
            DataTable dt = DbHelperSQL.Query(SQL).Tables[0];
            foreach (DataRow dr in dt.Rows) {
                Exam.Core.Model.Department obj = new Exam.Core.Model.Department();
                obj.DepartmentID = dr["DepartmentID"].ToString().Trim();
                obj.DepartmentName = dr["DepartmentName"].ToString().Trim();
                list.Add(obj);
            }
            //可以加入缓存
            return list;

        }

    }
}
